this.BX=this.BX||{};(function(e,t,i,n,l){"use strict";var r=function(e){babelHelpers.inherits(i,e);function i(e){var t;var n;babelHelpers.classCallCheck(this,i);n=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this));n.setEventNamespace("BX.UI.LayoutForm");n.params=e!==null&&e!==void 0?e:{};n.container=(t=n.params.container)!==null&&t!==void 0?t:document.documentElement;n.nodes=null;n.init();return n}babelHelpers.createClass(i,[{key:"init",value:function e(){var n=this;this.nodes=[].slice.call(this.container.querySelectorAll("["+i.HIDDEN_ATTRIBUTE+"]"));this.nodes.forEach((function(e){t.Event.bind(e,"click",(function(t){t.preventDefault();n.toggleBLock(e);n.emit("onToggle",{checkbox:e.querySelector(i.CHECKBOX_SELECTOR)})}));e.querySelector(i.CHECKBOX_SELECTOR).style.pointerEvents="none";n.checkInitialBlockVisibility(e)}))}},{key:"checkInitialBlockVisibility",value:function e(n){var l=n.querySelector(i.CHECKBOX_SELECTOR);if(l&&l.checked){var r=n.nextElementSibling;if(r){r.style.height="auto";t.Dom.addClass(r,i.SHOW_CLASS)}}}},{key:"toggleBLock",value:function e(n){var l=n.querySelector(i.CHECKBOX_SELECTOR);if(l){var r=n.nextElementSibling;if(r){var o=r.scrollHeight;if(o>0){if(!l.checked){l.checked=true;r.style.height=o+"px";t.Dom.addClass(r,i.SHOW_CLASS);var s=function e(){r.style.height="auto";t.Event.unbind(r,"transitionend",e)};t.Event.bind(r,"transitionend",s)}else{l.checked=false;r.style.height=o+"px";requestAnimationFrame((function(){r.style.height=0;t.Dom.removeClass(r,i.SHOW_CLASS)}))}}}}}}]);return i}(l.EventEmitter);babelHelpers.defineProperty(r,"HIDDEN_ATTRIBUTE","data-form-row-hidden");babelHelpers.defineProperty(r,"SHOW_CLASS","ui-form-row-hidden-show");babelHelpers.defineProperty(r,"CHECKBOX_SELECTOR",'.ui-ctl-element[type="checkbox"]');e.LayoutForm=r})(this.BX.UI=this.BX.UI||{},BX,BX,BX,BX.Event);
//# sourceMappingURL=layout-form.bundle.map.js